import { Navigate, Outlet } from 'react-router-dom'

import { useAuth } from '@/hooks/useAuth'

const AuthLayout = () => {
  const { isLogin } = useAuth()
  if (isLogin) {
    return <Outlet />
  }
  return <Navigate to="/login" />
}

export default AuthLayout
